package com.example.myapplication;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.WebView;
import android.widget.Toast;

import com.example.myapplication.drag.FloatMenuManager;
import com.example.myapplication.fixation.FloatMenuGiftbag;


public class MainActivity extends AppCompatActivity {

    private static final String TAG = "-----MainActivity-----";
    private WebView contentWebView = null;
    private Context context=MainActivity.this;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initview();

    }

    private void initview() {


        findViewById(R.id.show).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                FloatMenuGiftbag floatMenuGiftbag=FloatMenuGiftbag.getInstance();
                floatMenuGiftbag.showFloatMenu(context);
                FloatMenuManager.getInstance().showFloatMenu(context);

            }
        });

        findViewById(R.id.hide).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                FloatMenuGiftbag floatMenuGiftbag=FloatMenuGiftbag.getInstance();
                floatMenuGiftbag.hideFloatMenu();
                FloatMenuManager.getInstance().hideFloatMenu();

            }
        });


        findViewById(R.id.init).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Toast.makeText(context,"初始化",Toast.LENGTH_SHORT).show();

            }
        });


        findViewById(R.id.login).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(context,"登录",Toast.LENGTH_SHORT).show();


            }
        });


        findViewById(R.id.pay).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Toast.makeText(context,"pay",Toast.LENGTH_SHORT).show();

            }
        });













    }


    @Override
    protected void onResume() {
        super.onResume();
        //FloatMenuGiftbag.getInstance().showFloatMenu(this);
        Log.d(TAG,"onResume");

    }

    @Override
    public void onStop() {
        Log.d(TAG,"stop");
        super.onStop();
        //FloatMenuGiftbag.getInstance().hideFloatMenu();
    }

    @Override
    protected void onPause() {
        Log.d(TAG,"onPause");
        super.onPause();
    }
}